﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DFGK_WMS.Model.Models
{
    public abstract class BaseEntity
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        public long Id { get; set; }

        /// <summary>
        /// 创建用户Id
        /// </summary>
        public long CreateUserId { get; set; }

        /// <summary>
        /// 创建用户名
        /// </summary>
        [MaxLength(20)]
        public string CreateUserName { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateDate { get; set; }

        [NotMapped]
        public string CreateDates
        {
            get
            {
                return CreateDate.ToString("yyyy-MM-dd HH:mm:ss");
            }
        }

        /// <summary>
        /// 修改用户Id
        /// </summary>
        public long ModifyUserId { get; set; }

        /// <summary>
        /// 修改用户名
        /// </summary>
        [MaxLength(20)]
        public string ModifyUserName { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        public DateTime ModifyDate { get; set; }

        [NotMapped]
        public string ModifyDates
        {
            get
            {
                return ModifyDate.ToString("yyyy-MM-dd HH:mm:ss");
            }
        }

        /// <summary>
        /// 逻辑删除
        /// </summary>
        public bool IsDel { get; set; } = false;
    }
}
